package com.uzhie.util;

/**
 * @author ZhangDequan
 *         <p>
 *         通用常量类定义
 *         </p>
 * @since jdk
 */
public interface ConstantKit {

    final public static String REDIS_GPS_KEY = "gpsRecord";

    /**
     * 通用状态
     */
    interface STATUS {
        //删除
        int DELETED = 0;
        // 可用 启用
        int IS_AVAILABLE = 1;
        // 不可用，禁用
        int UN_AVAILABLE = 2;
    }



    /**
     * 码流状态
     */

    enum STEAM {
        MAIN(0), OTHER(1);
        private int type = -1;

        private STEAM(int type) {
            this.type = type;
        }

        public int getType() {
            return type;
        }
    }

    enum BASEDATA {
        /**
         * 字典类型  {部门类型 = 1,角色类型= 2 ,车辆类型= 3,终端类型= 4,报警类型= 5,其他= 6,生产厂家 = 7,车牌颜色 = 8}
         */
        DEPT(1, "部门类型","departType"),
        ROLETYPE(2,"角色类型","roleType"),
        VEHICLE(3, "车辆类型","vehicleType"),
        EQUIP(4, "终端类型","equipmentType"),
        WARNING(5, "报警类型","warnType"),
        OTHER(6, "其他","other"),
        FACTORY(7, "生产厂家","factoryType"),
        COLOR(8, "车牌颜色","color");

        private int type = -1;
        private String name = null;
        private String value = null;

        BASEDATA(int type, String name,String value) {
            this.type = type;
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public int getType() {
            return type;
        }

        public String getValue(){return value;}
    }


    /**
     * 视频相关报警
     */
    enum MEDIAWARN {
        LOSS(0, "信号丢失"),
        OCCL(1, "信号遮挡"),
        STORAGER(2, "存储单元故障"),
        OTHER(3, "其他报警"),
        OVERLOAD(4, "超员"),
        ABNORMAL(5, "异常驾驶"),
        SPECIAL(6, "特殊报警");
        private int type = -1;
        private String name = null;

        MEDIAWARN(int type, String name) {
            this.type = type;
            this.name = name;
        }

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

    }

    /**
     * 异常驾驶行为
     */
    enum MEDIAFATIGURE {
        FLAG(0, "疲劳"),
        CALL(1, "打电话"),
        SMOKE(2, "抽烟");
        private int type = -1;
        private String name = null;

        MEDIAFATIGURE(int type, String name) {
            this.type = type;
            this.name = name;
        }

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }
    }

    /**
     * 告警的处理状态
     * 0 删除 1 未处理 2 已处理 3 误报 4 忽略
     */
    enum WARNSTATUS {
        DELETE(0), PENDING(1), HANDLED(2), MISTAKE(3), IGNORE(4);
        private int type = -1;

        private WARNSTATUS(int type) {
            this.type = type;
        }

        public int getType() {
            return type;
        }
    }


    /**
     * 流媒体配置文件
     */
    enum MEDIA {
        URL("media_url"), IP("media_ip"), TCP("media_tcp_live_port"), TCP_REPLAY("media_tcp_replay_port"),
        VIDEO_TCP_LIVE("media_video_live_port"),VIDEO_TCP_REPLAY("media_video_replay_port"),VIDEO_DOWN("media_video_down_port"),
        UDP("media_udp_port"), OFFTIME("media_knock_off_time"),
        RECONNECT("media_reconnect_times"), UP("media_up_size"), DOWN("media_down_size");
        private static String name = "media";
        private String child;

        MEDIA(String child) {
            this.child = child;
        }

        public static String getName() {
            return name;
        }

        public String N() {
            return child;
        }
    }

    /**
     * 文件上传配置
     */
    enum UPLOAD {
        URL("upload_ftp_url"), PORT("upload_ftp_port"), MEDIA("upload_media_file"), AUDIO("upload_audio_file"), PIC("upload_pic_file"), USER("upload_ftp_username"), PWD("upload_ftp_password");
        private static String name = "upload";
        private String child;

        UPLOAD(String child) {
            this.child = child;
        }

        public static String getName() {
            return name;
        }

        public String N() {
            return child;
        }
    }

    /**
     * 上级平台配置
     */
    enum LEVEL {
        CODE("level_code"), TIME("level_reconnect_times");
        private static String name = "level";
        private String child;

        LEVEL(String child) {
            this.child = child;
        }

        public static String getName() {
            return name;
        }

        public String N() {
            return child;
        }
    }

}
